#ifndef AST_STATEMENT_JUMP_STMT_H
#define AST_STATEMENT_JUMP_STMT_H

#include "../ASTNode.h"
class sym;
class Expression;

/*
C99   6.8.6
jump-statement:
		goto    identifier   ;
		continue   ;
		break    ;
		return   expression(opt)    ;
*/
class JumpStmt  : public ASTNode
{
public:
	enum{
		goto_stmt,
		continue_stmt,
		break_stmt,
		return_stmt,
	};
public:
	JumpStmt(int iType)
		: ASTNode(ASTNode::jump_statement)
		, m_iType(iType){};

	JumpStmt(sym *pId)
		: ASTNode(ASTNode::jump_statement)
		, m_iType(goto_stmt)
		, m_pIdentifier(pId){};

	JumpStmt(Expression *pExpr = NULL )
		: ASTNode(ASTNode::jump_statement)
		, m_iType(return_stmt)
		, m_pExpr(pExpr) {};

	virtual ~JumpStmt(void);

	virtual void					codeGen();

protected:
	tiny_int						m_iType;
	union{
		sym *						m_pIdentifier;
		Expression *				m_pExpr;
	};
};


#endif

